const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        planYear: 2020,
        brandCode: 'string',
        marketDepartmentName: 'string',
        country: 'string',
        dealerCode: 'string',
        status: 1,
        creatorName: 'string',
        createTime: '2020-06-17T02:06:43.696Z',
        remark: 'string',
        rowVersion: 'string',
        options: [
            'update',
            'abandon',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                planYear: 2020,
                brandCode: 'string',
                marketDepartmentName: 'string',
                country: 'string',
                dealerCode: 'string',
                status: 1,
                creatorName: 'string',
                createTime: '2020-06-17T02:06:43.696Z',
                abandonerName: 'string',
                abandonTime: '2020-06-17T02:06:43.696Z',
                remark: 'string',
                rowVersion: 'string',
                options: [
                    'update',
                    'abandon',
                ],
                details: [
                    {
                        id: '1',
                        businessType: 2,
                        versionCode: 'string',
                        versionName: 'string',
                        modelCode: 'string',
                        modelName: 'string',
                        materialGroupKDBOMCode: 'string',
                        isNewModel: true,
                        n1SalesTargetQuantity: 10,
                        n2SalesTargetQuantity: 20,
                        n3SalesTargetQuantity: 30,
                        n4SalesTargetQuantity: 40,
                        n5SalesTargetQuantity: 50,
                        n6SalesTargetQuantity: 60,
                        n7SalesTargetQuantity: 70,
                        n8SalesTargetQuantity: 80,
                        n9SalesTargetQuantity: 90,
                        n10SalesTargetQuantity: 100,
                        n11SalesTargetQuantity: 110,
                        n12SalesTargetQuantity: 120,
                        total: 1200,
                        remark: 'string'
                    }
                ],
            }
        }
    );
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});
router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废成功'
    });
});
router.get('/export', (req, res) => {
    res.json({
        message: '导出成功'
    });
});
router.post('/import', async(req, res) => {
    res.json({
        message: '导入成功'
    });
});
module.exports = router;
